package com.xinghou.platform.server.api.service.impl;

import com.xinghou.platform.lucene.main.StoreLuceneService;
import com.xinghou.platform.model.main.SearchPolymerization;
import com.xinghou.platform.model.main.Store;
import com.xinghou.platform.server.api.service.StoreLuceneApiService;
import org.springframework.stereotype.Service;

import javax.annotation.Resource;
import java.io.IOException;
import java.util.List;

@Service("storeApiService")
public class StoreLuceneApiServiceImpl extends BaseDAOProtery<StoreLuceneService> implements StoreLuceneApiService {

	//private String daoUrl = httpServicesLuceneDaourl + "dao/main/storeLucene";
	@Resource
	private StoreLuceneService storeLuceneService ;
	@Override
	public List<Store> getSearchStoreInfos(String key, int fromno, int pagesize,String City_id,double distinct,double lat,double lng)
			throws IOException {
		// TODO Auto-generated method stub
		return storeLuceneService.getSearchStoreInfos(true,key, fromno, pagesize, City_id,distinct, lat, lng);
	}

	@Override
	public List<SearchPolymerization> getSearchPolymerization(boolean share,String key,double distinct, double lat, double lng,double level, String userType, String citycode){
		// TODO Auto-generated method stub
		return storeLuceneService.getSearchPolymerization(share, key, distinct, lat, lng, level,  userType,citycode);
	}
	@Override
	public List<Store> getSearchStoreInfos(String key, int fromno, int pagesize, double distinct,double lat, double lng) throws IOException {
		return storeLuceneService.getSearchStoreInfos(true,key, fromno, pagesize, null,distinct, lat, lng);
	}

	@Override
	public int saveStore(Store store) {
		// TODO Auto-generated method stub
		return storeLuceneService.saveStore(store);
	}
	@Override
	public int updateStore(Store store) {
		// TODO Auto-generated method stub
		return storeLuceneService.updateStore(store);
	}
	@Override
	public List<Store> getSearchStoreInfos(String key, int fromno, int pagesize)
			throws IOException {
		// TODO Auto-generated method stub
		return storeLuceneService.getSearchStoreInfos(key, fromno, pagesize);
	}
	
	

}
